<!doctype html>
<html>
<head>
    <meta charset=utf-8>
    <title></title>
    <meta name="robots" content="noindex,nofollow">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?=Web_Path?>packs/layui/css/layui.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/font.css">
    <link rel="stylesheet" href="<?=Web_Path?>packs/admin/css/style.css">
    <script src="<?=Web_Path?>packs/js/jquery.min.js"></script>
    <script src="<?=Web_Path?>packs/layui/layui.js"></script>
    <script src="<?=Web_Path?>packs/admin/js/cscms.js"></script>
</head>
<body>
    <span class="layui-breadcrumb" >
        <a ><cite><i class="fa fa-map-marker"></i>位置</cite></a>
        <a href="<?=site_url('dance/admin/dance')?>">音乐</a>
        <a href="<?=site_url('dance/admin/opt/play')?>">试听记录</a>
    </span>
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li><a class="tablink" href="<?=site_url('dance/admin/opt/fav')?>">歌曲收藏记录</a></li>
            <li><a class="tablink" href="<?=site_url('dance/admin/opt/down')?>">歌曲下载记录</a></li>
            <li class="layui-this"><a class="tablink" href="<?=site_url('dance/admin/opt/play')?>">歌曲试听记录</a></li>
        </ul>
        <div class="layui-tab-content" style="min-height: 360px;">
            <form class="layui-form layui-form-so" action="<?=site_url('dance/admin/opt/play')?>" method="post">
                <div class="layui-form-item">
                    <div class="layui-input-inline">
                        <select class="select" name="zd">
                           <option value="user"<?php if($zd=='user') echo ' selected';?>>会员</option>
                           <option value="name"<?php if($zd=='name') echo ' selected';?>>名称</option>
                        </select>
                    </div>
                    <div class="layui-input-inline">
                        <input type="text" name="key" value="<?=$key?>" class="layui-input">
                    </div>
                    <label class="layui-form-label">试听时间</label>
                    <div class="layui-input-inline">
                        <input style="width:90px;" name="kstime" id="kstime" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})" type="text" value="<?=$kstime?>" class="layui-input" /> 
                    </div>
                    <div class="layui-input-inline">-</div>
                    <div class="layui-input-inline">
                        <input style="width:90px;" name="jstime" id="jstime" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})" value="<?=$jstime?>" type="text" class="layui-input" />
                    </div>
                     <div class="layui-input-inline">
                        <button class="layui-btn" type="submit">查询</button>
                    </div>
                </div>
            </form>
            <form class="layui-form" action="<?=site_url('dance/admin/opt/play_del')?>" method="post">
                <table class="layui-table">
                    <colgroup>
                        <col width="40">
                        <col>
                        <col>
                    </colgroup>
                    <thead>
                        <tr>
                            <th>选</th>
                            <th class="phide">ID</th>
                            <th class="phide">图片</th>
                            <th>名称</th>
                            <th>会员</th>
                            <th class="phide">试听时间</th>
                            <th class="phide">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php
                        if(empty($play)) echo '<tr><td align="center" height="50" colspan="7">没有找到相关记录</td></tr>';
                        foreach ($play as $row) {
                            $links=linkurl('play','id',$row->did,1,'dance');
                            $pic=!empty($row->pic)?'<img height="30" src="'.piclink('dance',getzd('dance','pic',$row->did)).'">':'-';
                            //时间加亮
                            if(date('Y-m-d',$row->addtime)==date('Y-m-d')){
                                $addtime='<font color=red>'.date('Y-m-d',$row->addtime).'</font>';
                            }else{
                                $addtime=date('Y-m-d',$row->addtime);
                            }
                            echo '
                            <tr id="row_'.$row->id.'">
                            <td><input class="xuan" name="id['.$row->id.']" type="checkbox" value="'.$row->id.'" /></td>
                            <td class="phide">'.$row->id.'</td>
                            <td class="phide">'.$pic.'</td>
                            <td><a href="'.$links.'" target="play">'.$row->name.'</a></td>
                            <td>'.getzd('user','name',$row->uid).'</td>
                            <td class="phide">'.$addtime.'</td>
                            <td class="phide"><a class="layui-btn layui-btn-mini layui-btn-danger" href="javascript:cscms.del_one(\''.site_url('dance/admin/opt/play_del').'\','.$row->id.');">删除</a></td>
                            </tr> ';
                        }
                        ?>
                    </tbody>
                </table>
                <div class="more_func">
                    <a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.select_all();"><i class="fa fa-check colorl" ></i>全选/反选</a>
                    <a class="layui-btn layui-btn-primary layui-btn-small" lay-submit lay-filter="del_pl"><i class="fa fa-close " style="color: red" ></i>删除选中</a>
                    <div class="next-line"><a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.go_confirm('<?=site_url('dance/admin/opt/play_pldel')?>?id=3','确定删除3个月以前的记录？');" ><i class="fa fa-trash colord" ></i>删除3个月以前的记录</a>
                    <a class="layui-btn layui-btn-primary layui-btn-small" href="javascript:cscms.go_confirm('<?=site_url('dance/admin/opt/play_pldel')?>','确定要删除所有记录吗?');"><i class="fa fa-trash colorr" ></i>删除所有记录</a></div>
                </div>
            </form>
            <div id="page">
                <div class="data_nums phide"><?=$page_data?></div>
                <div class="data_page"><?=$page_list?></div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        cscms.init();
    </script>
</body>
</html>